home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / pcq_incl3v1.lha / DOS / DOSExtens.i < prev    next >
Encoding:
Text File  |  1994-04-15  |  21.5 KB  |  608 lines

  1. {
  2.         DOSExtens.i for PCQ Pascal
  3.  
  4.         DOS structures not needed for the casual AmigaDOS user
  5. }
  6.  
  7. {$I   "Include:Exec/Tasks.i"}
  8. {$I   "Include:Exec/Ports.i"}
  9. {$I   "Include:Exec/Libraries.i"}
  10. {$I   "Include:Exec/Semaphores.i"}
  11. {$I   "Include:Devices/Timer.i"}
  12. {$I   "Include:DOS/DOS.i"}
  13.  
  14.  
  15. Type
  16.  
  17. { All DOS processes have this structure }
  18. { Create and Device Proc returns pointer to the MsgPort in this structure }
  19. { dev_proc = Address(Integer(DeviceProc()) - SizeOf(Task)) }
  20.  
  21.     Process = record
  22.         pr_Task         : Task;
  23.         pr_MsgPort      : MsgPort;      { This is BPTR address from DOS functions  }
  24.         pr_Pad          : Short;        { Remaining variables on 4 byte boundaries }
  25.         pr_SegList      : BPTR;         { Array of seg lists used by this process  }
  26.         pr_StackSize    : Integer;      { Size of process stack in bytes            }
  27.         pr_GlobVec      : Address;      { Global vector for this process (BCPL)    }
  28.         pr_TaskNum      : Integer;      { CLI task number of zero if not a CLI      }
  29.         pr_StackBase    : BPTR;         { Ptr to high memory end of process stack  }
  30.         pr_Result2      : Integer;      { Value of secondary result from last call }
  31.         pr_CurrentDir   : BPTR;         { Lock associated with current directory   }
  32.         pr_CIS          : BPTR;         { Current CLI Input Stream                  }
  33.         pr_COS          : BPTR;         { Current CLI Output Stream                 }
  34.         pr_ConsoleTask  : Address;      { Console handler process for current window}
  35.         pr_FileSystemTask : Address;    { File handler process for current drive   }
  36.         pr_CLI          : BPTR;         { pointer to ConsoleLineInterpreter         }
  37.         pr_ReturnAddr   : Address;      { pointer to previous stack frame           }
  38.         pr_PktWait      : Address;      { Function to be called when awaiting msg  }
  39.         pr_WindowPtr    : Address;      { Window for error printing }
  40.         { following definitions are new with 2.0 }
  41.         pr_HomeDir      : BPTR;         { Home directory of executing program      }
  42.         pr_Flags        : Integer;      { flags telling dos about process          }
  43.         pr_ExitCode     : Address;      { code to call on exit of program OR NULL  }
  44.         pr_ExitData     : Integer;      { Passed as an argument to pr_ExitCode.    }
  45.         pr_Arguments    : String;       { Arguments passed to the process at start }
  46.         pr_LocalVars    : MinList;      { Local environment variables             }
  47.         pr_ShellPrivate : Integer;      { for the use of the current shell         }
  48.         pr_CES          : BPTR;         { Error stream - IF NULL, use pr_COS       }
  49.     end;
  50.     ProcessPtr = ^Process;
  51.  
  52. {
  53.  * Flags for pr_Flags
  54.  }
  55. CONST
  56.  PRB_FREESEGLIST       =  0 ;
  57.  PRF_FREESEGLIST       =  1 ;
  58.  PRB_FREECURRDIR       =  1 ;
  59.  PRF_FREECURRDIR       =  2 ;
  60.  PRB_FREECLI           =  2 ;
  61.  PRF_FREECLI           =  4 ;
  62.  PRB_CLOSEINPUT        =  3 ;
  63.  PRF_CLOSEINPUT        =  8 ;
  64.  PRB_CLOSEOUTPUT       =  4 ;
  65.  PRF_CLOSEOUTPUT       =  16;
  66.  PRB_FREEARGS          =  5 ;
  67.  PRF_FREEARGS          =  32;
  68.  
  69.  
  70. { The long word address (BPTR) of this structure is returned by
  71.  * Open() and other routines that return a file.  You need only worry
  72.  * about this struct to do async io's via PutMsg() instead of
  73.  * standard file system calls }
  74.  
  75. Type
  76.  
  77.     FileHandleRec = record
  78.         fh_Link         : MessagePtr;   { EXEC message        }
  79.         fh_Port         : MsgPortPtr;   { Reply port for the packet }
  80.         fh_Type         : MsgPortPtr;   { Port to do PutMsg() to
  81.                                           Address is negative if a plain file }
  82.         fh_Buf          : Integer;
  83.         fh_Pos          : Integer;
  84.         fh_End          : Integer;
  85.         fh_Func1        : Integer;
  86.         fh_Func2        : Integer;
  87.         fh_Func3        : Integer;
  88.         fh_Arg1         : Integer;
  89.         fh_Arg2         : Integer;
  90.     end;
  91.     FileHandlePtr = ^FileHandleRec;
  92.  
  93. { This is the extension to EXEC Messages used by DOS }
  94.  
  95.     DOSPacket = record
  96.         dp_Link : MessagePtr;   { EXEC message        }
  97.         dp_Port : MsgPortPtr;   { Reply port for the packet }
  98.                                 { Must be filled in each send. }
  99.         dp_Type : Integer;      { See ACTION_... below and
  100.                                 * 'R' means Read, 'W' means Write to the
  101.                                 * file system }
  102.         dp_Res1 : Integer;      { For file system calls this is the result
  103.                                 * that would have been returned by the
  104.                                 * function, e.g. Write ('W') returns actual
  105.                                 * length written }
  106.         dp_Res2 : Integer;      { For file system calls this is what would
  107.                                 * have been returned by IoErr() }
  108.         dp_Arg1 : Integer;
  109.         dp_Arg2 : Integer;
  110.         dp_Arg3 : Integer;
  111.         dp_Arg4 : Integer;
  112.         dp_Arg5 : Integer;
  113.         dp_Arg6 : Integer;
  114.         dp_Arg7 : Integer;
  115.     end;
  116.     DOSPacketPtr = ^DOSPacket;
  117.  
  118.  
  119. { A Packet does not require the Message to be before it in memory, but
  120.  * for convenience it is useful to associate the two.
  121.  * Also see the function init_std_pkt for initializing this structure }
  122.  
  123.  
  124.     StandardPacket = record
  125.         sp_Msg          : Message;
  126.         sp_Pkt          : DOSPacket;
  127.     end;
  128.     StandardPacketPtr = ^StandardPacket;
  129.  
  130.  
  131. Const
  132.  
  133. { Packet types }
  134.     ACTION_NIL                  = 0;
  135.     ACTION_GET_BLOCK            = 2;    { OBSOLETE }
  136.     ACTION_SET_MAP              = 4;
  137.     ACTION_DIE                  = 5;
  138.     ACTION_EVENT                = 6;
  139.     ACTION_CURRENT_VOLUME       = 7;
  140.     ACTION_LOCATE_OBJECT        = 8;
  141.     ACTION_RENAME_DISK          = 9;
  142.     ACTION_WRITE                = $57;  { 'W' }
  143.     ACTION_READ                 = $52;  { 'R' }
  144.     ACTION_FREE_LOCK            = 15;
  145.     ACTION_DELETE_OBJECT        = 16;
  146.     ACTION_RENAME_OBJECT        = 17;
  147.     ACTION_MORE_CACHE           = 18;
  148.     ACTION_COPY_DIR             = 19;
  149.     ACTION_WAIT_CHAR            = 20;
  150.     ACTION_SET_PROTECT          = 21;
  151.     ACTION_CREATE_DIR           = 22;
  152.     ACTION_EXAMINE_OBJECT       = 23;
  153.     ACTION_EXAMINE_NEXT         = 24;
  154.     ACTION_DISK_INFO            = 25;
  155.     ACTION_INFO                 = 26;
  156.     ACTION_FLUSH                = 27;
  157.     ACTION_SET_COMMENT          = 28;
  158.     ACTION_PARENT               = 29;
  159.     ACTION_TIMER                = 30;
  160.     ACTION_INHIBIT              = 31;
  161.     ACTION_DISK_TYPE            = 32;
  162.     ACTION_DISK_CHANGE          = 33;
  163.     ACTION_SET_DATE             = 34;
  164.  
  165.     ACTION_SCREEN_MODE          = 994;
  166.  
  167.     ACTION_READ_RETURN          = 1001;
  168.     ACTION_WRITE_RETURN         = 1002;
  169.     ACTION_SEEK                 = 1008;
  170.     ACTION_FINDUPDATE           = 1004;
  171.     ACTION_FINDINPUT            = 1005;
  172.     ACTION_FINDOUTPUT           = 1006;
  173.     ACTION_END                  = 1007;
  174.     ACTION_TRUNCATE             = 1022; { fast file system only }
  175.     ACTION_WRITE_PROTECT        = 1023; { fast file system only }
  176.  
  177. { new 2.0 packets }
  178.     ACTION_SAME_LOCK       = 40;
  179.     ACTION_CHANGE_SIGNAL   = 995;
  180.     ACTION_FORMAT          = 1020;
  181.     ACTION_MAKE_LINK       = 1021;
  182. {}
  183. {}
  184.     ACTION_READ_LINK       = 1024;
  185.     ACTION_FH_FROM_LOCK    = 1026;
  186.     ACTION_IS_FILESYSTEM   = 1027;
  187.     ACTION_CHANGE_MODE     = 1028;
  188. {}
  189.     ACTION_COPY_DIR_FH     = 1030;
  190.     ACTION_PARENT_FH       = 1031;
  191.     ACTION_EXAMINE_ALL     = 1033;
  192.     ACTION_EXAMINE_FH      = 1034;
  193.  
  194.     ACTION_LOCK_RECORD     = 2008;
  195.     ACTION_FREE_RECORD     = 2009;
  196.  
  197.     ACTION_ADD_NOTIFY      = 4097;
  198.     ACTION_REMOVE_NOTIFY   = 4098;
  199.  
  200. {
  201.  * A structure for holding error messages - stored as array with error == 0
  202.  * for the last entry.
  203.  }
  204. Type
  205.        ErrorString = Record
  206.         estr_Nums     : Address;
  207.         estr_Strings  : Address;
  208.        END;
  209.        ErrorStringPtr = ^ErrorString;
  210.  
  211.  
  212. { DOS library node structure.
  213.  * This is the data at positive offsets from the library node.
  214.  * Negative offsets from the node is the jump table to DOS functions
  215.  * node = (struct DosLibrary *) OpenLibrary( "dos.library" .. )      }
  216.  
  217. Type
  218.  
  219.     DOSLibrary = record
  220.         dl_lib          : Library;
  221.         dl_Root         : Address;      { Pointer to RootNode, described below }
  222.         dl_GV           : Address;      { Pointer to BCPL global vector       }
  223.         dl_A2           : Integer;      { Private register dump of DOS        }
  224.         dl_A5           : Integer;
  225.         dl_A6           : Integer;
  226.         dl_Errors       : ErrorStringPtr;  { pointer to array of error msgs }
  227.         dl_TimeReq      : TimeRequestPtr;  { private pointer to timer request }
  228.         dl_UtilityBase  : LibraryPtr;      { private ptr to utility library }
  229.  
  230.     end;
  231.     DOSLibraryPtr = ^DOSLibrary;
  232.  
  233.     RootNode = record
  234.         rn_TaskArray    : BPTR;         { [0] is max number of CLI's
  235.                                           [1] is APTR to process id of CLI 1
  236.                                           [n] is APTR to process id of CLI n }
  237.         rn_ConsoleSegment : BPTR;       { SegList for the CLI }
  238.         rn_Time         : DateStampRec; { Current time }
  239.         rn_RestartSeg   : Integer;      { SegList for the disk validator process }
  240.         rn_Info         : BPTR;         { Pointer ot the Info structure }
  241.         rn_FileHandlerSegment : BPTR;   { segment for a file handler }
  242.         rn_CliList      : MinList;      { new list of all CLI processes }
  243.                                         { the first cpl_Array is also rn_TaskArray }
  244.         rn_BootProc     : MsgPortPtr;   { private ptr to msgport of boot fs      }
  245.         rn_ShellSegment : BPTR;         { seglist for Shell (for NewShell)         }
  246.         rn_Flags        : Integer;      { dos flags }
  247.     end;
  248.     RootNodePtr = ^RootNode;
  249.  
  250. CONST
  251.  RNB_WILDSTAR   = 24;
  252.  RNF_WILDSTAR   = 16777216;
  253.  RNB_PRIVATE1   = 1;       { private for dos }
  254.  RNF_PRIVATE1   = 2;
  255.  
  256. Type
  257.     DOSInfo = record
  258.         di_McName       : BPTR; { Network name of this machine; currently 0 }
  259.         di_DevInfo      : BPTR; { Device List }
  260.         di_Devices      : BPTR; { Currently zero }
  261.         di_Handlers     : BPTR; { Currently zero }
  262.         di_NetHand      : Address;      { Network handler processid; currently zero }
  263.         di_DevLock,                      { do NOT access directly! }
  264.         di_EntryLock,                    { do NOT access directly! }
  265.         di_DeleteLock : SignalSemaphore; { do NOT access directly! }
  266.     end;
  267.     DOSInfoPtr = ^DOSInfo;
  268.  
  269. { ONLY to be allocated by DOS! }
  270.        CliProcList = Record
  271.         cpl_Node   : MinNode;
  272.         cpl_First  : Integer;      { number of first entry in array }
  273.         cpl_Array  : Array[0..0] of MsgPortPtr;
  274.                              { [0] is max number of CLI's in this entry (n)
  275.                               * [1] is CPTR to process id of CLI cpl_First
  276.                               * [n] is CPTR to process id of CLI cpl_First+n-1
  277.                               }
  278.        END;
  279.        CliProcListPtr = ^CliProcList;
  280.  
  281. { structure for the Dos resident list.  Do NOT allocate these, use       }
  282. { AddSegment(), and heed the warnings in the autodocs!                   }
  283.  
  284. Type
  285.        Segment = Record
  286.         seg_Next  : BPTR;
  287.         seg_UC    : Integer;
  288.         seg_Seg   : BPTR;
  289.         seg_Name  : Array[0..3] of Char;      { actually the first 4 chars of BSTR name }
  290.        END;
  291.        SegmentPtr = ^Segment;
  292.  
  293. CONST
  294.  CMD_SYSTEM    =  -1;
  295.  CMD_INTERNAL  =  -2;
  296.  CMD_DISABLED  =  -999;
  297.  
  298.  
  299. { DOS Processes started from the CLI via RUN or NEWCLI have this additional
  300.  * set to data associated with them }
  301. Type
  302.     CommandLineInterface = record
  303.         cli_Result2     : Integer;      { Value of IoErr from last command }
  304.         cli_SetName     : BSTR;         { Name of current directory }
  305.         cli_CommandDir  : BPTR;         { Lock associated with command directory }
  306.         cli_ReturnCode  : Integer;      { Return code from last command }
  307.         cli_CommandName : BSTR;         { Name of current command }
  308.         cli_FailLevel   : Integer;      { Fail level (set by FAILAT) }
  309.         cli_Prompt      : BSTR;         { Current prompt (set by PROMPT) }
  310.         cli_StandardInput : BPTR;       { Default (terminal) CLI input }
  311.         cli_CurrentInput : BPTR;        { Current CLI input }
  312.         cli_CommandFile : BSTR;         { Name of EXECUTE command file }
  313.         cli_Interactive : Integer;      { Boolean; True if prompts required }
  314.         cli_Background  : Integer;      { Boolean; True if CLI created by RUN }
  315.         cli_CurrentOutput : BPTR;       { Current CLI output }
  316.         cli_DefaultStack : Integer;     { Stack size to be obtained in long words }
  317.         cli_StandardOutput : BPTR;      { Default (terminal) CLI output }
  318.         cli_Module      : BPTR;         { SegList of currently loaded command }
  319.     end;
  320.     CommandLineInterfacePtr = ^CommandLineInterface;
  321.  
  322. { This structure can take on different values depending on whether it is
  323.  * a device, an assigned directory, or a volume.  Below is the structure
  324.  * reflecting volumes only.  Following that is the structure representing
  325.  * only devices.
  326.  }
  327.  
  328. { structure representing a volume }
  329.  
  330.     DeviceList = record
  331.         dl_Next         : BPTR;         { bptr to next device list }
  332.         dl_Type         : Integer;      { see DLT below }
  333.         dl_Task         : MsgPortPtr;   { ptr to handler task }
  334.         dl_Lock         : BPTR;         { not for volumes }
  335.         dl_VolumeDate   : DateStampRec; { creation date }
  336.         dl_LockList     : BPTR;         { outstanding locks }
  337.         dl_DiskType     : Integer;      { 'DOS', etc }
  338.         dl_unused       : Integer;
  339.         dl_Name         : BSTR;         { bptr to bcpl name }
  340.     end;
  341.     DeviceListPtr = ^DeviceList;
  342.  
  343. { device structure (same as the DeviceNode structure in filehandler.h) }
  344.  
  345.     DevInfo = record
  346.         dvi_Next        : BPTR;
  347.         dvi_Type        : Integer;
  348.         dvi_Task        : Address;
  349.         dvi_Lock        : BPTR;
  350.         dvi_Handler     : BSTR;
  351.         dvi_StackSize   : Integer;
  352.         dvi_Priority    : Integer;
  353.         dvi_Startup     : Integer;
  354.         dvi_SegList     : BPTR;
  355.         dvi_GlobVec     : BSTR;
  356.         dvi_Name        : BSTR;
  357.     end;
  358.     DevInfoPtr = ^DevInfo;
  359.  
  360. {    structure used for multi-directory assigns. AllocVec()ed. }
  361.  
  362.        AssignList = Record
  363.         al_Next : ^AssignList;
  364.         al_Lock : BPTR;
  365.        END;
  366.        AssignListPtr = ^AssignList;
  367.  
  368.  
  369. { combined structure for devices, assigned directories, volumes }
  370.  
  371.     dol_Handler = Record
  372.      dol_Handler    : String;    {    file name to load IF seglist is null }
  373.      dol_StackSize,              {    stacksize to use when starting process }
  374.      dol_Priority,               {    task priority when starting process }
  375.      dol_Startup    : Integer;   {    startup msg: FileSysStartupMsg for disks }
  376.      dol_SegList,                {    already loaded code for new task }
  377.      dol_GlobVec    : BPTR;      {    BCPL global vector to use when starting
  378.                                  * a process. -1 indicates a C/Assembler
  379.                                  * program. }
  380.     END;
  381.     dol_HandlerPtr = ^dol_Handler;
  382.  
  383.     dol_Volume = Record
  384.      dol_VolumeDate : DateStampRec;  {    creation date }
  385.      dol_LockList   : BPTR;       {    outstanding locks }
  386.      dol_DiskType   : Integer;    {    'DOS', etc }
  387.     END;
  388.     dol_VolumePtr = ^dol_Volume;
  389.  
  390.     dol_assign = Record
  391.         dol_AssignName  : String;        {    name for non-OR-late-binding assign }
  392.         dol_List        : AssignListPtr; {    for multi-directory assigns (regular) }
  393.     END;
  394.     dol_AssignPtr = ^dol_assign;
  395.  
  396.  
  397.    DosList = Record
  398.     dol_Next            : BPTR;           {    bptr to next device on list }
  399.     dol_Type            : Integer;        {    see DLT below }
  400.     dol_Task            : MsgPortPtr;     {    ptr to handler task }
  401.     dol_Lock            : BPTR;
  402.     dol_Misc            : Array[0..23] of Byte;
  403.     dol_Name            : String;         {    bptr to bcpl name }
  404.    END;
  405.    DosListPtr = ^DosList;
  406.  
  407. Const
  408.  
  409. { definitions for dl_Type }
  410.  
  411.     DLT_DEVICE          = 0;
  412.     DLT_DIRECTORY       = 1;
  413.     DLT_VOLUME          = 2;
  414.     DLT_LATE            = 3;       {    late-binding assign }
  415.     DLT_NONBINDING      = 4;       {    non-binding assign }
  416.     DLT_PRIVATE         = -1;      {    for internal use only }
  417.  
  418. {    structure return by GetDeviceProc() }
  419. Type
  420.        DevProc = Record
  421.         dvp_Port        : MsgPortPtr;
  422.         dvp_Lock        : BPTR;
  423.         dvp_Flags       : Integer;
  424.         dvp_DevNode     : DosListPtr;    {    DON'T TOUCH OR USE! }
  425.        END;
  426.        DevProcPtr = ^DevProc;
  427.  
  428. CONST
  429. {    definitions for dvp_Flags }
  430.      DVPB_UNLOCK   =  0;
  431.      DVPF_UNLOCK   =  1;
  432.      DVPB_ASSIGN   =  1;
  433.      DVPF_ASSIGN   =  2;
  434.  
  435. {    Flags to be passed to LockDosList(), etc }
  436.      LDB_DEVICES   =  2;
  437.      LDF_DEVICES   =  4;
  438.      LDB_VOLUMES   =  3;
  439.      LDF_VOLUMES   =  8;
  440.      LDB_ASSIGNS   =  4;
  441.      LDF_ASSIGNS   =  16;
  442.      LDB_ENTRY     =  5;
  443.      LDF_ENTRY     =  32;
  444.      LDB_DELETE    =  6;
  445.      LDF_DELETE    =  64;
  446.  
  447. {    you MUST specify one of LDF_READ or LDF_WRITE }
  448.      LDB_READ      =  0;
  449.      LDF_READ      =  1;
  450.      LDB_WRITE     =  1;
  451.      LDF_WRITE     =  2;
  452.  
  453. {    actually all but LDF_ENTRY (which is used for internal locking) }
  454.      LDF_ALL       =  (LDF_DEVICES+LDF_VOLUMES+LDF_ASSIGNS);
  455.  
  456. {    error report types for ErrorReport() }
  457.      REPORT_STREAM          = 0;       {    a stream }
  458.      REPORT_TASK            = 1;       {    a process - unused }
  459.      REPORT_LOCK            = 2;       {    a lock }
  460.      REPORT_VOLUME          = 3;       {    a volume node }
  461.      REPORT_INSERT          = 4;       {    please insert volume }
  462.  
  463. {    Special error codes for ErrorReport() }
  464.      ABORT_DISK_ERROR       = 296;     {    Read/write error }
  465.      ABORT_BUSY             = 288;     {    You MUST replace... }
  466.  
  467. {    types for initial packets to shells from run/newcli/execute/system. }
  468. {    For shell-writers only }
  469.      RUN_EXECUTE           =  -1;
  470.      RUN_SYSTEM            =  -2;
  471.      RUN_SYSTEM_ASYNCH     =  -3;
  472.  
  473. {    Types for fib_DirEntryType.  NOTE that both USERDIR and ROOT are      }
  474. {    directories, and that directory/file checks should use <0 and >=0.    }
  475. {    This is not necessarily exhaustive!  Some handlers may use other      }
  476. {    values as needed, though <0 and >=0 should remain as supported as     }
  477. {    possible.                                                             }
  478.      ST_ROOT       =  1 ;
  479.      ST_USERDIR    =  2 ;
  480.      ST_SOFTLINK   =  3 ;      {    looks like dir, but may point to a file! }
  481.      ST_LINKDIR    =  4 ;      {    hard link to dir }
  482.      ST_FILE       =  -3;      {    must be negative for FIB! }
  483.      ST_LINKFILE   =  -4;      {    hard link to file }
  484.  
  485.  
  486. Type
  487.  
  488. { a lock structure, as returned by Lock() or DupLock() }
  489.  
  490.     FileLockRec = record
  491.         fl_Link         : BPTR;         { bcpl pointer to next lock }
  492.         fl_Key          : Integer;      { disk block number }
  493.         fl_Access       : Integer;      { exclusive or shared }
  494.         fl_Task         : MsgPortPtr;   { handler task's port }
  495.         fl_Volume       : BPTR;         { bptr to a DeviceList }
  496.     end;
  497.     FileLockPtr = ^FileLockRec;
  498.  
  499. PROCEDURE AbortPkt(P : MsgPortPtr; Packet : DOSPacketPtr);
  500.     External;
  501.  
  502. Function CreateProc(name : String; pri : Integer;
  503.                         segment : BPTR; stackSize : Integer) : ProcessPtr;
  504.     External;
  505.  
  506. Function DeviceProc(name : String) : ProcessPtr;
  507.     External;
  508.  
  509. FUNCTION CreateNewProc(Tags : Address) : ProcessPtr;
  510.     External;
  511.  
  512. FUNCTION DoPkt(ID : MsgPortPtr; Action, Param1, Param2, Param3, Param4, Param5 : Integer) : Integer;
  513.     External;  
  514.  
  515. Function LoadSeg(name : String) : BPTR;
  516.     External;
  517.  
  518. Procedure UnLoadSeg(segment : BPTR);
  519.     External;
  520.  
  521. FUNCTION AddDosEntry(DL : DosList) : Boolean;
  522.     External;
  523.  
  524. FUNCTION AttemptLockDosList(flags : Integer) : DosListPtr;
  525.     External;
  526.  
  527. FUNCTION Cli : CommandLineInterfacePtr;
  528.     External;
  529.  
  530. FUNCTION CliInitNewcli(Packet : DOSPacketPtr) : Integer;
  531.     External;
  532.  
  533. FUNCTION CliInitRun(Packet : DOSPacketPtr) : Integer;  
  534.     External;
  535.  
  536. FUNCTION FindDosEntry(initial : DosList; name : String; flags : Integer) : DosListPtr;
  537.     External;
  538.  
  539. FUNCTION FindSegment(name : String; entry : SegmentPtr; System : Integer) : SegmentPtr;
  540.     External;
  541.  
  542. PROCEDURE FreeDeviceProc(Dv : DevProcPtr);
  543.     External;
  544.  
  545. PROCEDURE FreeDosEntry(Entry : DosListPtr);
  546.     External;
  547.  
  548. FUNCTION FindCliProc(num : Integer) : ProcessPtr;
  549.     External;
  550.  
  551. FUNCTION GetConsoleTask : MsgPortPtr;
  552.     External;
  553.  
  554. FUNCTION GetDeviceProc(name : String; result : DevProcPtr) : DevProcPtr;
  555.     External;
  556.  
  557. FUNCTION GetFileSysTask : MsgPortPtr;
  558.     External;
  559.  
  560. PROCEDURE UnLockDosList(flags : Integer);
  561.     External;
  562.  
  563. FUNCTION LockDosList(value : Integer) : DosListPtr;
  564.     External;
  565.  
  566. FUNCTION InternalLoadSeg(SegList : BPTR; HunkTable : BPTR; FunctionArray : Address; StackSize : Integer) : BPTR;
  567.     External;
  568.  
  569. FUNCTION InternalUnLoadSeg(SegList : BPTR; func : Address) : Boolean;
  570.     External;
  571.  
  572. FUNCTION SetConsoleTask(n : MsgPortPtr) : MsgPortPtr;
  573.     External;
  574.  
  575. FUNCTION SetFileSystemTask(new : MsgPortPtr) : MsgPortPtr;
  576.     External;
  577.  
  578. PROCEDURE SendPkt(packet : DOSPacketPtr; port, replyport : MsgPortPtr);
  579.     External;
  580.  
  581. FUNCTION WaitPkt : DosPacketPtr;
  582.     External;
  583.  
  584. FUNCTION RemDosEntry(DL : DosListPtr) : Boolean;
  585.     External;
  586.  
  587. FUNCTION RemSegment(entry : SegmentPtr) : Boolean;
  588.     External;
  589.  
  590. PROCEDURE ReplyPkt(packet : DOSPacketPtr; res1, res2 : Integer);
  591.     External;
  592.  
  593. FUNCTION NewLoadSeg(name : String; Tags : Address) : BPTR;
  594.     External;
  595.  
  596. FUNCTION NextDosEntry(DL : DosListPtr; descriptor : Integer) : DosListPtr;
  597.     External;
  598.  
  599. FUNCTION MaxCli : Integer;
  600.     External;
  601.  
  602. FUNCTION MakeDosEntry(name : String; EntryType : Integer) : DosListPtr;
  603.     External;
  604.  
  605. FUNCTION AddSegment(name : String; SegList : BPTR; EntryType : Integer) : Boolean;
  606.     External;
  607.  
  608.